<template>
	<section class="body">
		<div class="panels">
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
			<div class="panel"></div>
		</div>
	</section>
</template>

<script type="text/javascript">
	
</script>

<style lang="scss" scoped>
$panelSize: 80;

.body {
  background: #000;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 800px;
}

.panels {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  width: $panelSize * 5px;
  height: $panelSize * 5px;
  animation: panelsRotate 30000ms linear infinite;
  transform-style: preserve-3d;
  .panel {
    position: relative;
    width: #{$panelSize}px;
    height: #{$panelSize}px;
    background: #fff;
    // border: 1px solid #000;
    box-sizing: border-box;
    transform-style: preserve-3d;
    box-shadow: 10px 0 100px rgba(0, 0, 0, 0.1) inset;
    &::after {
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      transform: translateZ(-2px);
      box-sizing: border-box;
    }
    @for $i from 0 through 100 {
      &:nth-child(#{$i + 1}) {
        animation: wing 5000ms $i * 100ms cubic-bezier(0.545, 0.080, 0.520, 0.975) infinite;
        transform-origin: 0% #{-$i * 11 + '%'};
        &::after {
          background: rgba(random(155) + 100, random(155) + 100, random(155) + 100, 1);
        }
      }
    }
  }
}

@keyframes panelsRotate {
  0% {
    transform: rotateX(70deg) rotateZ(0deg);
  }
  100% {
    transform: rotateX(70deg) rotateZ(360deg);
  }
}
@keyframes wing {
  0% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  50% {
    transform: rotateX(-360deg) rotateY(180deg);
  }
  65% {
    transform: rotateX(-360deg) rotateY(360deg);
  }
  100% {
    transform: rotateX(-360deg) rotateY(360deg);
  }
}
</style>